import * as types from './mutation_types'

export const showTips = ({commit}, tips) => {
  commit(types.SHOW_TIPS, {
    tips: tips
  })
  setTimeout(() => {
    commit(types.SHOW_TIPS, {
      tips: {
        message: '',
        show: false
      }
    })
  }, 800)
}

export const setUserInfo = ({commit}, userInfo) => {
  commit(types.SET_USERINFO, {
    userInfo: userInfo
  })
}

export const setGroup = ({commit}, group) => {
  commit(types.SET_GROUP, {
    group: group
  })
}

export const showloading = ({ commit }) => {
  commit(types.SHOW_LOADING)
}

export const hideloading = ({ commit }) => {
  commit(types.HIDE_LOADING)
}
